package com.example.demo.AiService;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import org.springframework.beans.factory.annotation.Qualifier;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT, //手动配置
        chatModel = "openAiChatModel", //指定模型
        streamingChatModel = "openAiStreamingChatModel", //指定流式调用
        chatMemoryProvider = "chatMemoryProvider", //配置会话记忆提供者对象
        contentRetriever = "contentRetriever" //配置内容提供者对象
)
public interface ConsultantService {
    /**
     * 用于聊天的方法
     * @param msg
     * @return
     */
    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chat(@MemoryId String memoryId,@UserMessage String msg);
}
